package com.atguigu.esdemo.entity;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;

import java.util.Map;

/**
 * @author fenge
 */
@Data
public class Goods {
    private String title;
    private String images;
    private Integer price;
    private Integer stock;
    private Boolean saleable;
    private Attr attr;
    private String highLightTitle;

    public void setAttr(Map<String,Object> map){
        ObjectMapper mappers = new ObjectMapper();
        this.attr = mappers.convertValue(mappers,Attr.class);
    }

    /*
    public void setUser(Map<String, Object> map){

        ObjectMapper mapper = new ObjectMapper();
        this.user = mapper.convertValue(map, User.class);
    }
     */
}
